<?php

/**
 * Copyright              [HD框架] (C)2011-2012 houdunwang ，Inc. 
 * Encoding               UTF-8 
 * Version                $Id: functions      2012-8-23 13:04:34
 * @author                向军
 * Link                   http://www.houdunwang.com       
 * E-mail                 houdunwangxj@gmail.com
 */
function format_config($data) {
 
	foreach ($data as $k => $v) {

    	$data[$k] = get_config_html($v);
    }
    return $data;
}

function get_config_html($v) {
   $html = '';
    switch ($v['viewtype']) {
        case "string":
            $html.= "<tr><td class='title'>" . $v['title'] . "</td>";
            $html.="<td class='input'><input type='text' name='{$v["name"]}' value='{$v["value"]}' style='width:300px;'/></td>";
            $html.="<td class='msg'>{$v['msg']}</td>";
            $html.="<td class='var'>{\$hd.conf." . $v['name'] . "}</td></tr>";
            break;
        case "select":
           $html.="<tr><td class='title'>".$v['title']."</td>";
         //  $arrstr=expload(',',$v['viewvalue']);
          // $html.="<select value='$v["name"]'>"
           
          // $html.=
           
           
           
           
           
           //</tr>"
        	break;
        case "radio":
            break;
        case "checkbox";
            break;
    }
    $v['html'] = $html;
    return $v;
}

?>
